package com.xr.wage.taxRatio;

import com.bstek.dorado.view.AbstractViewModel;
import com.bstek.dorado.common.DoradoContext;
import com.bstek.dorado.data.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;
import com.bstek.dorado.common.MessageHelper;

import com.xr.common.DBTools;

/**
 * taxRatioAddViewModel
 */
public class taxRatioAddViewModel extends AbstractViewModel {
	
	
	public void addTaxRatio(ParameterSet parameters) throws Exception {		
		String newId = DBTools.getNewId("SQ_PAYROLL");		
		Dataset dataset = this.getDataset("datasetTaxBase");		
		dataset.setValue("pay_taxbase_id", newId);        
		Dataset dataset1 = this.getDataset("datasetTaxTable");
		RecordIterator ri = dataset1.recordIterator();

		while (ri.hasNext()) {			
			Record record = ri.nextRecord();
			record.setValue("pay_taxbase_id", newId);
		}

		super.doUpdate(parameters);
	}
    
}
